package com.kid.keep.controller;


import com.kid.keep.request.AddUserRequest;
import com.kid.keep.vo.AddUserVO;
import com.kid.keep.vo.UserVO;
import com.honeybee.cloud.framework.common.response.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Description 爬虫任务
 * @Author DELL
 * @Create 2019-04-29
 * @Since 1.0.0
 */
@RequestMapping("kid-keep")
public interface IUserController {

    /**
     * 保存登录用户信息
     *
     * @param addUserRequest
     * @return
     */
    @RequestMapping(name = "保存登录用户信息", value = "/v1/users", method = RequestMethod.PUT)
    ResponseEntity<AddUserVO> addUser(@RequestBody @Validated AddUserRequest addUserRequest);

    /**
     * 查询登录用户信息
     *
     * @param userId
     * @return
     */
    @RequestMapping(name = "查询登录用户信息", value = "/v1/users/{userId}", method = RequestMethod.GET)
    ResponseEntity<UserVO> getUserById(@PathVariable(name = "userId") Long userId);

    /**
     * 查询用户的小孩数量
     *
     * @param userId
     * @return
     */
    @RequestMapping(name = "查询用户的小孩数量", value = "/v1/users/{userId}/children/number", method = RequestMethod.GET)
    ResponseEntity<Integer> countChildByParentId(@PathVariable("userId") Long userId);

}
